package com.ian.util;

import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;

/**
 * @author Witt
 * @version 1.0.0
 * @date 2022/5/18
 */
public class BizUtils {

    public static String getClientTokenStr(String id, OAuth2AuthorizedClient authorizedClient) {
        String clientToken = String.format("%s: %n<br>access token: token type: %s, token value: %s%n<br>refresh token: token value: %s%n<br>",
                id,
                authorizedClient.getAccessToken().getTokenType().getValue(),
                authorizedClient.getAccessToken().getTokenValue(),
                authorizedClient.getRefreshToken().getTokenValue());
        System.out.println("clientToken: " + clientToken);
        return clientToken;
    }
}
